<template>
  <div class="app-container">
  	<h4>基本信息</h4>
    <div class="change">
      
      <p>
        <span>借用人</span>
        <input v-model="tempData.borrowPerson" type="text" placeholder="请输入借用人"  />
      </p>

      <p>
        <span>借出时间</span>
        <el-date-picker v-model="tempData.borrowTime" type="date" value-format="yyyy-MM-dd" class="userselect" ></el-date-picker>
      </p>
      
      <p>
        <span>预计归还时间</span>
        <el-date-picker v-model="tempData.predictReturnTime" type="date" value-format="yyyy-MM-dd" class="userselect" ></el-date-picker>
      </p>
      <p>
        <span>实际归还时间</span>
        <el-date-picker v-model="tempData.returnTime" type="date" value-format="yyyy-MM-dd" class="userselect" ></el-date-picker>
      </p>
    </div>
    
    
    <h4>选择资产</h4>
    <div class="zd3-btm">
      
      <el-table :data="proData" :show-header="true" style="width: 100%;border-radius: 8px;">
        
        <el-table-column type="index" align="center" width="50" label="序号" fixed="left" />
        <el-table-column align="center" prop="propertySn" width="100" label="资产SN编码" fixed="left" />
          <el-table-column align="center" prop="propertyName" width="100" label="资产名称" />
          <el-table-column align="center" prop="propertyType" width="150" label="资产类别" />
          <el-table-column align="center" prop="belongCompany" width="150" label="当前所在公司" />
          <el-table-column align="center" prop="departments" width="150" label="当前所在部门" />
          <el-table-column align="center" prop="usePerson" width="150" label="当前使用人" />
          <el-table-column align="center" prop="storeAreas" width="150" label="存放地点" />
        
        <el-table-column align="center" width="270" label="操作" fixed="right">
            <template slot-scope="scope">
              <el-button type="text" size="small" @click="chakan(scope.row, scope.$index)">查看</el-button>

            </template>
          </el-table-column>
          
      </el-table>
    </div>

    <div class="submits" >
		<div class="nosave" @click="nosaveOrder">返回</div>
	</div>
	<el-dialog title="资产详情" :visible.sync="zichanshow" width="70%">
		  <div class="product">
        <h4>基本信息</h4>
    <div class="change">
      
      <p>
        <span>资产类别</span>
        <input v-model="zichan.propertyType" type="text"  />
        
      </p>
      
      <p>
        <span>资产名称</span>
        <input v-model="zichan.propertyName" type="text" placeholder="请输入资产名称"  />
      </p>
      
      <p>
        <span>资产规格</span>
        <input v-model="zichan.propertyGuige" type="text" placeholder="请输入资产规格"  />
      </p>
      
      <p>
        <span>设备数量</span>
        <input v-model="zichan.propertyNums" type="text" placeholder="请输入设备数量"  />
      </p>
      
      <p>
        <span>金额</span>
        <input v-model="zichan.propertyJine" type="text" placeholder="请输入资产规格"  />
      </p>
      
      <p>
        <span>资产SN码</span>
        <input v-model="zichan.propertySn" type="text" placeholder="请输入资产SN码"  />
      </p>
      
      <p>
        <span>购买时间</span>
        <input v-model="zichan.purchaseTime" type="text"  />
      </p>
      
      <p>
        <span>来源</span>
        <input v-model="zichan.sourceOf" type="text"  />
        
      </p>
      <p>
        <span>存放地</span>
        <input v-model="zichan.storeAreas" type="text"  />
      </p>
      
      <p>
        <span>地区</span>
        <input v-model="zichan.areas" type="text"  />
      </p>
      
      <p>
        <span>所属公司</span>
         <input v-model="zichan.belongCompany" type="text"  />
      </p>
      
      <p>
        <span>使用公司</span>
        <input v-model="zichan.companys" type="text"  />
      </p>
      
      <p>
        <span>使用部门</span>
        <input v-model="zichan.departments" type="text"  />
      </p>
      
      <p>
        <span>使用人</span>
        <input v-model="zichan.usePerson" type="text" placeholder="请输入使用人"  />
      </p>
      
      <p>
        <span>管理员</span>
        <input v-model="zichan.managerPerson" type="text" placeholder="请输入管理员"  />
      </p>
      
      <p>
        <span>图片</span>
        <el-upload
            class="avatar-uploader"
            action=""
            :show-file-list="false"
            >
            <img v-if="zichan.imgurl" :src="tempData.imgurl" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
         </p>

    </div>
    
    
    <h4>维保信息</h4>
    <div class="change">
    	<p>
        <span>是否有备用</span>
        <input v-model="zichan.spareIs" type="text"  />
       
      </p>
      
    	<p>
        <span>使用期限</span>
        <input v-model="zichan.serviceLife" type="text"  />
      </p>
      
      <p>
        <span>巡检周期</span>
        <input v-model="zichan.maintainCycle" type="text"  />
      </p>
      
      <p>
        <span>供应商</span>
        <input v-model="zichan.suppliers" type="text" placeholder="请输入供应商"  />
      </p>
      
	
    	
    </div>
		  </div>
		   
		</el-dialog>
    
  </div>
</template>
<script>
import { getGongying,addCaigou,updateCaigouOrPro } from '@/api/caigou'
import { inStock } from '@/api/cangku'
export default {
  data() {
    return {
      radio: "1",
			total: 1,
      value: '',
      tableData: [],
      proData:[],
      oneClassify: [],   //一级分类
      twoClassify: [],
      tempData: {
        receiveArea: "",//领用后存放区域
        receiveCompany: "", //领用后使用公司
        receiveRemarks : "",//领用说明
        receivePerson: "",//领用人
        receiveDepartment:"", //领用后使用部门
        receiveTime:"", // 领用时间
        recipientsNumber:"", //领用单号
        managePerson :"",//领用处理人
        putList:[]
      },
			zichan:[],
      zichanshow:false,
			addProShow: false, //商品信息弹窗
      proData: [],
     
    };
  },
  mounted(){
      this.tempData = JSON.parse(this.$route.params.options)
      console.log(this.tempData)
      this.proData =this.tempData.putList
  },
  methods: {
		chakan(item,index){
      console.log(item,index)
      this.zichan = item
      console.log(this.zichan)
      this.zichanshow = true
    },
		
    goPrev(page) {
      console.log(page);
    },
    goNext(page) {
      console.log(page);
    },
    addzichan(){
    	this.addProShow = true
    	
    },
   
    
		// 取消新增
		nosaveOrder(){
			console.log('取消')
			this.$router.go(-1)
		}
  }
};
</script>
<style lang="scss" scoped>
.popup {
  padding: 0 20px;
}
.product{
  
  .pro-l{
    width: 200px;
  }
  .pro-r{
    flex: 1;
    overflow: hidden;
    /deep/.el-table--enable-row-hover .el-table__body tr:hover>td {
      background-color: rgba(24,160,94,.2);
    }
    /deep/.el-table tr{
      cursor: pointer;
    }
    /deep/.el-table__body tr.current-row>td {
      background-color: rgba(24,160,94,.4);
    }
  }
}
.files {
  display: flex;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  margin-top: 20px;
  overflow: hidden;
  padding: 20px;
}
.files-btm .btn-prev:after {
  content: "上一页";
}
.files-btm .btn-next:before {
  content: "下一页";
}
.files-btm .btn-prev,
.files-btm .btn-next {
  width: 65px;
}
.files-left {
	width: 160px;
	margin-right: 20px;
	/deep/.el-menu{
		border-right: none;
	}
	/deep/.el-menu-item{
		height: 35px;
		line-height: 35px;
		margin-bottom: 8px;
	}
	/deep/.el-menu-item.is-active{
		color: #fff;
		border-radius: 5px;
		background: rgba(24,160,94,.8);
	}
}
.files-right {
  flex: 1;
  overflow: hidden;
}
.files-btm {
  background: rgba(255, 255, 255, 1);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  // margin-top: 20px;
  overflow: hidden;
  &-title {
    display: flex;
    align-items: center;
    height: 45px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    > p {
      text-align: center;
      font-size: 16px;
      color: #333;
    }
  }
  .addDate {
    margin: 20px 32px 10px 32px;
    height: 32px;
    border-radius: 3px;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border: 1px dashed rgba(0, 0, 0, 0.3);
  }
  .el-button--text {
    margin: 0 15px;
  }
}
.avatar{
	width: 30px;
	height: 30px;
}
.zd3-btm {
  background: rgba(255, 255, 255, 1);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  overflow: hidden;
  &-title {
    display: flex;
    align-items: center;
    height: 70px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    > p {
      text-align: center;
      font-size: 16px;
      color: #333;
    }
  }
  .addDate {
    margin: 20px 32px 10px 32px;
    height: 32px;
    border-radius: 3px;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border: 1px dashed rgba(0, 0, 0, 0.3);
  }
  .el-button--text {
    margin: 0 15px;
  }
}
.inps {
  width: 95%;
  height: 32px;
  line-height: 32px;
  padding-left: 10px;
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.8);
}
.inps-active {
  width: 95%;
  height: 32px;
  line-height: 32px;
  padding-left: 10px;
  background: rgba(24,160,94,.2);
  border: none;
  color: rgba(0, 0, 0, 0.8);
}
h4{
	background: #fff;
	padding-top: 10px;
	padding-bottom: 10px;
	padding-left: 10px;
}
.change {
  display: flex;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-top: -5px;
  > p {
    width: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    color: #333;
    /deep/.el-input__inner {
      // width: inherit;
      background: none;
      height: 32px;
      // line-height: 32px;
      color: #333;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding: 0 25px;
    }
    /deep/.el-input__icon {
      line-height: 32px;
    }
    .userselect {
      // max-width: 250px;
      flex: 1;
    }

    > span {
      display: block;
      width: 120px;
      text-align: right;
      padding-right: 15px;
    }
    > input {
      width: inherit;
      flex: 1;
      height: 32px;
      border-radius: 3px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding-left: 10px;
      color: #333;
    }
  }
}
.submits{
	display: flex;
	padding: 15px 20px;
	justify-content: flex-end;
	align-items: center;
	>div{
		width: 80px;
		height: 32px;
		text-align: center;
		line-height: 32px;
		color: #fff;
		font-size: 14px;
		border-radius: 4px;
		margin-left: 30px;
		cursor: pointer;
	}
	.save{
		background: #2196F3;
	}
	.nosave{
		background: #2196F3;
	}
}

.avatar-uploader .el-upload {
	  border: 1px dashed #999 !important;
	  border-radius: 6px;
	  cursor: pointer;
	  position: relative;
	  overflow: hidden;
	  width: 100%;
	}
	.avatar-uploader .el-upload:hover {
	  border-color: #409eff;
	}
	
	.avatar-uploader-icon {
	  font-size: 28px;
	  color: #8c939d;
	  width: 100px;
	  height: 100px;
	  line-height: 100px;
	  text-align: center;
		border: 1px solid #ccc
	}
	.avatar {
	  width: 100px;
	  height: 100px;
	  display: block;
	}




.fileup{
  padding: 20px 0;
  display: flex;
  flex-wrap: wrap;
	background: #fff;
	border-radius: 0 0 8px 8px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	// justify-content: space-between;
  // align-items: center;
  flex-direction: column;
  // justify-content: center;
  > p {
    width: 50%;
    font-size: 14px;
    display: flex;
		flex-wrap: wrap;
    align-items: center;
    color: #333;
    /deep/.el-input__inner {
      // width: inherit;
      background: none;
      height: 32px;
      // line-height: 32px;
      color: #333;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding: 0 25px;
    }
    /deep/.el-input__icon {
      line-height: 32px;
    }
    /deep/.el-upload-dragger {
			width: 100%;
      height: 100px;
    }
    /deep/.el-upload-dragger .el-icon-upload {
      font-size: 60px;
      color: #C0C4CC;
      margin: 0; 
      line-height: 1;
			width: 100%;
    }
		/deep/.el-upload {
			width: 100%;
		}
    .userselect {
      // max-width: 250px;
      flex: 1;
    }

    > span {
      display: inline-block;
      width: 100px;
      text-align: right;
      padding-right: 15px;
			&:last-child{
				text-align: left;
			}
    }
    > input {
      width: inherit;
      flex: 1;
      height: 32px;
      border-radius: 3px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding-left: 10px;
      color: #333;
    }
		>strong{
			display: inline-block;
			padding-right: 100px;
			font-weight: 100;
			font-size: 14px;
			&:last-child{
				cursor: pointer;
				color: #13ce66;
				font-weight: 600;
			}
		}
    >div{
      width: inherit;
      flex: 1;
    }
  }
}
@media screen and (max-width: 1400px) {
  .change > p {
    width: 33%;
  }
}
</style>